/**
 * 
 */
package com.henryzhou.cloud.response;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

import org.w3c.dom.Document;


/**
 * @author haozhou
 *
 */
public class GetResponse extends BaseResponse implements IResponse {
	private Document doc;
	private Object body;
	private String contentType;

	public GetResponse(Object response) {
		super(response);
	}
	
	public void setDocument(Document doc) {
		this.doc = doc;
	}
	
	public Document getDocument() {
		return this.doc;
	}

	public Object getBody() {
		return body;
	}

	public void setBody(Object body) {
		this.body = body;
	}

	public String getContentType() {
		return contentType;
	}

	public void setContentType(String contentType) {
		this.contentType = contentType;
	}

	@Override
	public OutputStream getContent() throws IOException {
		if (body instanceof File) {
			return new FileOutputStream((File)body);
		} 
		return null;
	}
}
